package wisents.wicket.element;

import static junit.framework.Assert.assertEquals;
import org.apache.wicket.markup.html.form.TextArea;
import wisents.api.PageElement;

public final class IsTextAreaWithValueElementCriteria extends AbstractWicketElementCriteria {

    private final String textAreaValue;


    public IsTextAreaWithValueElementCriteria(PageElement pageElement, String value) {
        super(pageElement);
        this.textAreaValue = value;
    }

    public void validateCriteria() {
        TextArea textArea = (TextArea) tester.getComponentFromLastRenderedPage(pageElement.path());
        assertEquals(textAreaValue, textArea.getValue());
    }

}
